/*
 * Created: 2022-08-27 13:37:00
 * Author : 涛涛涛
 */

import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
export interface IProps extends ICompProps {
    icon: React.ReactNode;
    text: string;
}
OpeButton.defaultProps = {} as Partial<IProps>;
function OpeButton(props: IProps) {
    const { className, style, icon, text } = props;
    const localClassName = useClassName('OpeButton', className);
    return (
        <RootView className={localClassName} style={style}>
            <Text className="Text iconfont">{icon}</Text>
            <Text className="Text text">{text}</Text>
        </RootView>
    );
}
export default React.memo(OpeButton as FC<IProps>);
const RootView = styled(View)`
    &.OpeButton {
        margin: 30px auto;
        padding: 40px 0;
        width: 650px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #ff8828;
        border-radius: 10px;
        line-height: 1;
        .Text {
            color: #fff;
            font-size: 30px;
        }
        .text {
            margin-left: 20px;
        }
    }
    &.OpeButton + .OpeButton {
        margin-top: 20px;
    }
`;
